/*****************************************************************************************
   
   Copyright (c) Microsoft Corporation. All rights reserved.

   Use of this code sample is subject to the terms of the Microsoft
   Permissive License, a copy of which should always be distributed with
   this file.  You can also access a copy of this license agreement at:
   http://www.microsoft.com/resources/sharedsource/licensingbasics/permissivelicense.mspx

 ****************************************************************************************/

using System;

namespace GrooveWebServicesV12Helpers
{
	/// <summary>
	/// Declares constants and interfaces for use in the helper library.
	/// </summary>
	public class Shared
	{
		#region Registry Keys/Values

        //  Keys for Groove 12 client use
        public const string GROOVE_12_REG_KEY = @"Software\Microsoft\Office\12.0\Groove";
        public const string GROOVE_12_WEB_SERVICES_REG_KEY = GROOVE_12_REG_KEY + @"\WebServices";
        public const string GROOVE_12_WEB_SERVICES_HELPERS_REG_KEY = GROOVE_12_REG_KEY + @"\WebServicesHelpers";

        //  Keys for Groove 12 server use
        public const string GROOVE_12_SERVER_REG_KEY = @"Software\Microsoft\Office Server\12.0\Groove";
        public const string GROOVE_12_SERVER_WEB_SERVICES_REG_KEY = GROOVE_12_SERVER_REG_KEY + @"\WebServices";
        public const string GROOVE_12_SERVER_WEB_SERVICES_HELPERS_REG_KEY = GROOVE_12_SERVER_REG_KEY + @"\WebServicesHelpers";

        //  Keys for Groove 3.x client and server use
        public const string GROOVE_REG_KEY = @"Software\Groove Networks, Inc.\Groove";
		public const string GROOVE_WEB_SERVICES_REG_KEY = GROOVE_REG_KEY + @"\WebServices";
		public const string GROOVE_WEB_SERVICES_HELPERS_REG_KEY = GROOVE_REG_KEY + @"\WebServicesHelpers";

		public const string GROOVE_CURRENT_VERSION_REG_KEY_NAME = "CurVer";
		public const string GROOVE_HTTP_DESIRED_PORT_REG_KEY_NAME = @"GrooveHTTPDesiredPort";
		public const string GROOVE_LOCAL_HTTP_PORT_REG_KEY_NAME = @"GrooveLocalHTTPPort";
		public const string GROOVE_WEB_SERVICES_LOCAL_REQUEST_KEY = @"LocalRequestKey";
		public const string GROOVE_WEB_SERVICES_LOCAL_RESPONSE_KEY = @"LocalResponseKey";
		public const string GROOVE_DEFAULT_PORT = @"9080";

		#endregion

		#region Web Services URIs

		public const string GROOVE_WEB_SERVICES_ACCOUNTS_URI = @"/GWS/Groove/2.0/Accounts";
		public const string GROOVE_WEB_SERVICES_SPACES_URI = @"/GWS/Groove/2.0/Spaces/";
		public const string GROOVE_WEB_SERVICES_TOOLS_URI = @"/GWS/Groove/2.0/Tools/";
		public const string GROOVE_WEB_SERVICES_CONTACTS_URI = @"/GWS/Groove/2.0/Contacts/";
		public const string GROOVE_WEB_SERVICES_MEMBERS_URI = @"/GWS/Groove/2.0/Members/";
		public const string GROOVE_WEB_SERVICES_SUBSCRIPTIONS_URI = @"/GWS/Groove/2.0/Subscriptions/";
		public const string GROOVE_WEB_SERVICES_EVENTS_URI = @"/GWS/Groove/2.0/Events/";
		public const string GROOVE_WEB_SERVICES_FILES_URI = @"/GWS/Groove/2.0/Files/";
		public const string GROOVE_WEB_SERVICES_VCARD_URI = @"/GWS/Groove/2.0/vCard/";
		public const string GROOVE_WEB_SERVICES_LOCAL_URI = @"/GWS/Groove/2.0/Local/";
		public const string GROOVE_WEB_SERVICES_FORMS_URI = @"/GWS/Groove/2.0/Forms/";
        public const string GROOVE_WEB_SERVICES_FORMS2_URI = @"/GWS/Groove/2.0/Forms2/";
		public const string GROOVE_WEB_SERVICES_PROPERTIES_URI = @"/GWS/Groove/2.0/Properties/";
		public const string GROOVE_WEB_SERVICES_MESSAGES_URI = @"/GWS/Groove/2.0/Messages/";
        public const string GROOVE_WEB_SERVICES_APPLICATION_URI = @"/GWS/Groove/2.0/Application/";

		#endregion

		#region Roles
		
		public const string GROOVE_MANAGER_ROLE = @"$Telespace.Manager";
		public const string GROOVE_PARTICIPANT_ROLE = @"$Telespace.Member";
		public const string GROOVE_GUEST_ROLE = @"$Telespace.Guest";

		#endregion

		#region Create Space Templates
		
		public const string GROOVE_GENERIC_CREATE_SPACE_TEMPLATE = @"urn:groove.net:Groove.Core.Tools.System.TelespaceTypes.Generic";

		#endregion

		#region Contact Types
		
		public const string GROOVE_PERSONAL_CONTACT_TYPE = @"urn:groove.net:Core.PersonalContact";
		public const string GROOVE_TELESPACE_MEMBER_CONTACT_TYPE = @"urn:groove.net:Core.TelespaceMember";

		#endregion

		#region Supported Types

		public const string GROOVE_FILES_TOOL_SUPPORTED_TYPE = @"urn:groove.net:platform.tools.Files";
		public const string GROOVE_DISCUSSION_TOOL_SUPPORTED_TYPE = @"urn:groove.net:platform.tools.Discussion";
		public const string GROOVE_CALENDAR_TOOL_SUPPORTED_TYPE = @"urn:groove.net:platform.tools.Calendar";
		public const string GROOVE_FORMS_TOOL_SUPPORTED_TYPE = @"urn:groove.net:platform.tools.Forms";
		public const string GROOVE_FORMS2_TOOL_SUPPORTED_TYPE = @"urn:groove.net:platform.tools.Forms2";
        public const string GROOVE_INFOPATH_FORMS_TOOL_SUPPORTED_TYPE = @"urn:groove.net:platform.tools.InfoPathForms";
        public const string GROOVE_SHAREPOINT_FILES_TOOL_SUPPORTED_TYPE = @"urn:groove.net:platform.tools.WSSFiles";

		#endregion

		#region Subscription Event Classes
		
		public const string GROOVE_WEB_SERVICES_SPACE_EVENT_CLASS = @"urn:groove-net:Space2Event";
		public const string GROOVE_WEB_SERVICES_TOOL_EVENT_CLASS = @"urn:groove-net:Tool2Event";
		public const string GROOVE_WEB_SERVICES_CONTACT_EVENT_CLASS = @"urn:groove-net:Contact2Event";
		public const string GROOVE_WEB_SERVICES_FILES_EVENT_CLASS = @"urn:groove-net:Files2Event";
		public const string GROOVE_WEB_SERVICES_DISCUSSION_EVENT_CLASS = @"urn:groove-net:Discussion2Event";
		public const string GROOVE_WEB_SERVICES_CALENDAR_EVENT_CLASS = @"urn:groove-net:Calendar2Event";
		public const string GROOVE_WEB_SERVICES_CHAT_EVENT_CLASS = @"urn:groove-net:Chat2Event";
		public const string GROOVE_WEB_SERVICES_MEMBER_EVENT_CLASS = @"urn:groove-net:Member2Event";
		public const string GROOVE_WEB_SERVICES_FORMS_EVENT_CLASS = @"urn:groove-net:Forms2Event";
		public const string GROOVE_WEB_SERVICES_FORMS2_EVENT_CLASS = @"urn:groove-net:Forms3Event";
		public const string GROOVE_WEB_SERVICES_CONTACT_DIRECTORY_EVENT_CLASS = @"urn:groove-net:ContactDirectoryEvent";
		public const string GROOVE_WEB_SERVICES_MESSAGE_EVENT_CLASS = @"urn:groove-net:Messages2Event";

		#endregion

		#region Event Types

		public const string GROOVE_CONTACT_ADD_EVENT_TYPE = @"ContactAddEventData";
		public const string GROOVE_CONTACT_DELETE_EVENT_TYPE = @"ContactDeleteEventData";
		public const string GROOVE_CONTACT_UPDATE_EVENT_TYPE = @"ContactUpdateEventData";

		public const string GROOVE_CONTACT_DIRECTORY_FETCH_RESULTS_EVENT_TYPE = @"ContactFetchResultsEventData";
		public const string GROOVE_CONTACT_DIRECTORY_SEARCH_RESULTS_EVENT_TYPE = @"ContactSearchResultsEventData";

		public const string GROOVE_SPACE_ADD_EVENT_TYPE = @"SpaceAddEventData";
		public const string GROOVE_SPACE_DELETE_EVENT_TYPE = @"SpaceDeleteEventData";
		public const string GROOVE_SPACE_RENAME_EVENT_TYPE = @"SpaceRenameEventData";
		
		public const string GROOVE_TOOL_ADD_EVENT_TYPE = @"ToolAddEventData";
		public const string GROOVE_TOOL_DELETE_EVENT_TYPE = @"ToolDeleteEventData";
		public const string GROOVE_TOOL_RENAME_EVENT_TYPE = @"ToolRenameEventData";
		
		public const string GROOVE_MEMBER_ADD_EVENT_TYPE = @"MemberAddEventData";
		public const string GROOVE_MEMBER_DELETE_EVENT_TYPE = @"MemberDeleteEventData";
		public const string GROOVE_MEMBER_UPDATE_EVENT_TYPE = @"MemberUpdateEventData";
		
		public const string GROOVE_MEMBER_AWARENESS_CHANGED_EVENT_TYPE = @"MemberAwarenessEventData";
		public const string GROOVE_MEMBER_AWARENESS_ENTER_SPACE_EVENT_TYPE = @"MemberEnterSpaceEventData";
		public const string GROOVE_MEMBER_AWARENESS_EXIT_SPACE_EVENT_TYPE = @"MemberExitSpaceEventData";
		public const string GROOVE_MEMBER_AWARENESS_ENTER_TOOL_EVENT_TYPE = @"MemberEnterToolEventData";
		public const string GROOVE_MEMBER_AWARENESS_EXIT_TOOL_EVENT_TYPE = @"MemberExitToolEventData";
		
		public const string GROOVE_CALENDAR_ADD_EVENT_TYPE = @"CalendarAddEventData";
		public const string GROOVE_CALENDAR_DELETE_EVENT_TYPE = @"CalendarDeleteEventData";
		public const string GROOVE_CALENDAR_UPDATE_EVENT_TYPE = @"CalendarUpdateEventData";
		
		public const string GROOVE_DISCUSSION_ADD_EVENT_TYPE = @"DiscussionAddEventData";
		public const string GROOVE_DISCUSSION_DELETE_EVENT_TYPE = @"DiscussionDeleteEventData";
		public const string GROOVE_DISCUSSION_UPDATE_EVENT_TYPE = @"DiscussionUpdateEventData";
		
		public const string GROOVE_FILE_ADD_EVENT_TYPE = @"FileAddEventData";
		public const string GROOVE_FILE_DELETE_EVENT_TYPE = @"FileDeleteEventData";
		public const string GROOVE_FILE_RENAME_EVENT_TYPE = @"FileRenameEventData";
		public const string GROOVE_FILE_UPDATE_EVENT_TYPE = @"FileUpdateEventData";
		public const string GROOVE_FILE_MOVE_EVENT_TYPE = @"FileMoveEventData";
		public const string GROOVE_FILE_DOWNLOAD_PROGRESS_EVENT_TYPE = @"FileDownloadProgressEventData";
		
		public const string GROOVE_FORMS_RECORD_ADD_EVENT_TYPE = @"FormsRecordAddEventData";
		public const string GROOVE_FORMS_RECORD_DELETE_EVENT_TYPE = @"FormsRecordDeleteEventData";
		public const string GROOVE_FORMS_RECORD_UPDATE_EVENT_TYPE = @"FormsRecordUpdateEventData";

		public const string GROOVE_FORMS2_RECORD_ADD_EVENT_TYPE = @"Forms2RecordAddEventData";
		public const string GROOVE_FORMS2_RECORD_DELETE_EVENT_TYPE = @"Forms2RecordDeleteEventData";
		public const string GROOVE_FORMS2_RECORD_UPDATE_EVENT_TYPE = @"Forms2RecordUpdateEventData";

		public const string GROOVE_MESSAGE_RECEIVED_EVENT_TYPE = @"MessageReceivedEventData";
		public const string GROOVE_MESSAGE_OPENED_EVENT_TYPE = @"MessageOpenedEventData";
		public const string GROOVE_MESSAGE_DELETE_EVENT_TYPE = @"MessageDeleteEventData";
		public const string GROOVE_MESSAGE_SENT_EVENT_TYPE = @"MessageSentEventData";

		#endregion

		public interface IGrooveWebServicesEventCallback
		{
			void ProcessEvent(GrooveEventsWebService.Event i_Event);
		}

		public interface IGrooveWebServicesAdvancedEventCallback: IGrooveWebServicesEventCallback
		{
			void OnSubscriptionUpdated(GrooveWebServicesV12Helpers.Subscription i_Subscription);
			void OnEventProcessingCompleted(GrooveWebServicesV12Helpers.Subscription i_Subscription, long i_SequenceNumber);
			void OnEventsDeleted(GrooveWebServicesV12Helpers.Subscription i_Subscription, long i_SequenceNumber);
		}
	}
}
